<template>
  <div class="app-container">
    <v-form ref="queryForm" v-show="showSearch" label-width="68px">
      <v-row>
        <v-col md="2" style="padding-bottom: 2px">
          <v-text-field
            label="菜单名称"
            v-model="queryParams.menuName"
            placeholder="请输入菜单名称"
            outlined
            dense
            clearable
            @keyup.enter.native="handleQuery"
            style="width: 240px;"
          ></v-text-field>
        </v-col>
        <v-col md="2" style="padding-bottom: 2px;max-width: 150px">
          <v-select
            label="状态"
            v-model="queryParams.status"
            :items="statusOptions"
            item-text="dictLabel"
            item-value="dictValue"
            dense
            outlined
            clearable
            style="width: 130px;"
          ></v-select>
        </v-col>

        <!-- 按钮区-->
        <v-col cols="12"
               sm="6"
               md="2" style="padding-bottom: 0;height: 40px;margin-top: 8px">
          <p style="display: inline-block;position: absolute">
            <v-btn
              small color="primary"
              :loading="loading"
              @click="handleQuery">
              <v-icon left>
                mdi-magnify
              </v-icon>
              搜索
            </v-btn>
            <v-btn
              small
              :loading="loading"
              @click="resetQuery"
              style="margin-left: 10px"
            >
              <v-icon left>
                mdi-autorenew
              </v-icon>
              重置
            </v-btn>
          </p>
        </v-col>
      </v-row>
    </v-form>

    <!-- 表格操作按钮区 -->
    <v-row style="margin-bottom: -5px">
      <v-col md="1" style="max-width: 84px" v-ripple>
        <v-btn
          color="primary"
          plain
          small
          outlined
          @click="handleAdd"
          v-hasPermi="['system:menu:add']">
          <v-icon left>
            mdi-plus
          </v-icon>
          新增
        </v-btn>
      </v-col>
      <v-col style="float: right">
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
      </v-col>
    </v-row>

    <v-main>
      <v-treeview
        ref="deptTree"
        dense
        hoverable
        open-all
        :items="menuList" style="font-size: 14px;padding: 0!important;margin: 0 !important;"
      >
        <!-- 插槽 -->
        <template v-slot:prepend="{ item, open }" style="padding: 0 !important;margin: 0 !important;max-width: 99%;overflow: auto !important;">
          <div>
            <!-- 菜单名称-->
            <span style="display: inline-block;width: 165px;padding: 0 1px">
              {{ item.menuName }}
            </span>
            <!-- 图标 -->
            <span style="display: inline-block;width: 120px;padding: 0 10px;text-align: center;"  v-show="item.icon">
            <span v-show="item.icon != '#'" style="color: rgba(0, 0, 0, 0.6)">图标 </span><svg-icon :icon-class="item.icon" />
            </span>
            <!-- 排序 -->
            <span style="display: inline-block;width: 100px;padding: 0 10px;">
              <span v-show="item.orderNum" style="color: rgba(0, 0, 0, 0.6)">排序: {{ item.orderNum }}
              </span>
            </span>
            <!-- 权限标识 -->
            <span style="display: inline-block;padding: 0 10px;min-width: 185px">
              <v-tooltip top>
                <template v-slot:activator="{ on, attrs }">
                  <span v-show="item.perms" v-bind="attrs" v-on="on" class="omitted"
                        style="color: rgba(0, 0, 0, 0.6)">权限标识: {{ item.perms }}</span>
                </template>
                <span>权限标识: {{item.perms }}</span>
              </v-tooltip>
            </span>
            <!-- 组件路径 -->
            <span style="display: inline-block;padding: 0 10px;min-width: 185px">
              <v-tooltip top>
                <template v-slot:activator="{ on, attrs }">
                  <span v-show="item.component" v-bind="attrs" v-on="on" class="omitted"
                        style="color: rgba(0, 0, 0, 0.6)">组件路径: {{ item.component }}</span>
                </template>
                <span>组件路径: {{item.component }}</span>
              </v-tooltip>
            </span>
            <!-- 状态 -->
            <span style="display: inline-block;width: 100px;padding: 0 16px;text-align: center;">
              <span v-show="item.menuType != 'F'" style="color: rgba(0, 0, 0, 0.6)">状态: {{ statusFormat(item) }}</span>
            </span>
            <!-- 创建时间 -->
            <span style="display: inline-block;width: 240px;padding: 0 16px;">
             <span style="color: rgba(0, 0, 0, 0.6)">创建时间: {{ item.createTime }}</span>
            </span>
            <!-- 操作 -->
            <span style="min-width: 150px;position: absolute;display: inline-block;float: right;right: 12px;z-index: 10000">
              <v-btn text
                     small
                     plain
                     height="20"
                     width="40"
                     @click="handleUpdate(item)"
                     v-hasPermi="['system:menu:edit']">
                <v-icon small>
                  mdi-pencil
                </v-icon>
                修改
              </v-btn>
              <v-btn
                color="primary"
                plain
                small
                height="20"
                width="40"
                @click="handleAdd(item)"
                v-hasPermi="['system:menu:add']">
                <v-icon small>
                  mdi-plus
                </v-icon>
                新增
              </v-btn>
              <span v-if="item && !item.showConfirmDelete">
                <v-btn color="#C62828"
                       small
                       plain
                       height="20"
                       width="40"
                       @click="onClickDelete(item)">
                  <v-icon small>
                    mdi-delete
                  </v-icon>
                  删除
                </v-btn>
              </span>
              <!-- 删除确认 -->
              <span v-else>
                <v-tooltip top>
                  <template v-slot:activator="{ on, attrs }">
                    <v-btn
                      small color="error"
                      plain
                      height="20"
                      width="40"
                      v-bind="attrs"
                      v-on="on"
                      @click="handleDelete(item)"
                      v-hasPermi="['system:menu:remove']">
                      <v-icon small>
                        mdi-delete
                      </v-icon>
                      确定
                    </v-btn>
                  </template>
                  <span>请再次点击确定删除</span>
                </v-tooltip>
              </span>
            </span>
          </div>
        </template>
      </v-treeview>
    </v-main>

    <el-table
      v-loading="loading"
      :data="menuList"
      row-key="menuId"
      :tree-props="{children: 'children', hasChildren: 'hasChildren'}" v-if="false"
    >
      <el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="160"></el-table-column>
      <el-table-column prop="icon" label="图标" align="center" width="100">
        <template slot-scope="scope">
          <svg-icon :icon-class="scope.row.icon" />
        </template>
      </el-table-column>
      <el-table-column prop="orderNum" label="排序" width="60"></el-table-column>
      <el-table-column prop="perms" label="权限标识" :show-overflow-tooltip="true"></el-table-column>
      <el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true"></el-table-column>
      <el-table-column prop="status" label="状态" :formatter="statusFormat" width="80"></el-table-column>
      <el-table-column label="创建时间" align="center" prop="createTime">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:menu:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-plus"
            @click="handleAdd(scope.row)"
            v-hasPermi="['system:menu:add']"
          >新增</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:menu:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <!-- 编辑对话框 -->
    <v-dialog
      v-model="visible"
      persistent
      max-width="600px">

      <v-card>
        <!-- 对话框标题 -->
        <v-card-title>
          <span style="font-size: 18px">{{ title }}</span>
        </v-card-title>

        <!-- 表单 -->
        <v-form ref="form" v-model="valid">
          <v-card-text>
            <v-container>
              <v-row>
                <v-col cols="12" sm="12">
                  <v-menu
                    ref="menu"
                    v-model="showMenuOptions"
                    transition="scale-transition"
                    offset-y
                    max-width="600px"
                    style="padding: 0"
                  >
                    <template v-slot:activator="{ on, attrs }">
                      <v-text-field
                        v-model="form.parentName"
                        :rules="rules.parentId"
                        label="上级菜单"
                        placeholder="选择上级菜单"
                        v-bind="attrs"
                        v-on="on"
                        dense
                        style="padding: 0"
                      ></v-text-field>
                    </template>
                    <v-treeview
                      ref="tree"
                      dense
                      activatable
                      hoverable
                      return-object
                      :items="menuOptions" style="font-size: 14px;padding: 0;background-color: white;min-width: 500px !important;max-height: 450px;overflow: auto;"
                    >
                      <!-- 插槽 -->
                      <template v-slot:prepend="{ item, open }">
                        <div @click="handleNodeClick(item)">
                          {{ item.menuName }}
                        </div>
                      </template>
                    </v-treeview>
                  </v-menu>
                </v-col>
                <v-col cols="12" sm="12">
                  <v-radio-group
                    label="菜单类型"
                    hide-details
                    v-model="form.menuType"
                    row dense style="margin: 0;padding-bottom: 0"
                  >
                    <v-radio key="M" value="M" label="目录"></v-radio>
                    <v-radio key="C" value="C" label="菜单"></v-radio>
                    <v-radio key="F" value="F" label="按钮"></v-radio>
                  </v-radio-group>
                </v-col>

                <v-col cols="12" sm="12" md="12" v-if="form.menuType != 'F'">
                  <div style="display: inline-block;margin: 0 auto">
                    <v-card-title style="margin: 0;padding: 0;width: 65px;float: left;">
                      <span style="font-size: 14px;font-weight: 400;color: #00000099">菜单图标</span>
                    </v-card-title>
                    <div style="line-height: 2rem;width: 450px">
                      <svg-icon
                        v-if="form.icon"
                        slot="prefix"
                        :icon-class="form.icon"
                        class="el-input__icon"
                        style="width: 16px;"
                      />
                      <v-icon v-else>mdi-select</v-icon>
                      <v-btn v-if="!form.icon" color="primary" plain small text @click="visible2 = true">
                        点击选择图标
                      </v-btn>
                      <v-btn v-if="form.icon" plain small text @click="visible2 = true">
                        更换图标
                      </v-btn>
                    </div>
                  </div>
                </v-col>
                <v-col cols="12" sm="6" >
                  <v-text-field
                    v-model="form.menuName"
                    :rules="rules.menuName"
                    label="*菜单名称"
                    placeholder="请输入菜单名称"
                    required
                    clearable
                    dense
                  ></v-text-field>
                </v-col>
                <v-col cols="12" sm="6" md="6">
                  <v-text-field
                    v-model="form.orderNum"
                    label="*显示排序"
                    :rules="rules.orderNum"
                    type="number"
                    clearable
                    required
                    :min="0"
                    dense
                  ></v-text-field>
                </v-col>
                <v-col cols="12" sm="6" v-if="form.menuType != 'F'">
                  <v-radio-group
                    label="是否外链"
                    v-model="form.isFrame"
                    row dense style="margin: 0;"
                  >
                    <v-radio key="0" value="0" label="是"></v-radio>
                    <v-radio key="1" value="1" label="否"></v-radio>
                  </v-radio-group>
                </v-col>
                <v-col cols="12" sm="6" v-if="form.menuType != 'F'">
                  <v-text-field
                    v-model="form.path"
                    :rules="rules.path"
                    label="*路由地址"
                    placeholder="请输入路由地址"
                    required
                    clearable
                    dense
                  ></v-text-field>
                </v-col>
                <v-col cols="12" sm="6" v-if="form.menuType == 'C'">
                  <v-text-field
                    v-model="form.component"
                    :rules="rules.component"
                    label="组件路径"
                    placeholder="请输入组件路径"
                    required
                    clearable
                    dense
                  ></v-text-field>
                </v-col>
                <v-col cols="12" sm="6" v-if="form.menuType != 'M'">
                  <v-text-field
                    v-model="form.component"
                    :rules="rules.component"
                    label="权限标识"
                    placeholder="请输入权限标识"
                    required
                    clearable
                    dense
                  ></v-text-field>
                </v-col>
                <v-col cols="12" sm="6"  v-if="form.menuType != 'F'">
                  <v-radio-group
                    label="显示状态"
                    v-model="form.visible"
                    row dense style="margin: 0;"
                  >
                    <v-radio
                      v-for="dict in visibleOptions"
                      :key="dict.dictValue"
                      :label="dict.dictLabel"
                      :value="dict.dictValue"
                    ></v-radio>
                  </v-radio-group>
                </v-col>
                <v-col cols="12" sm="6" v-if="form.menuType != 'F'">
                  <v-radio-group
                                 label="菜单状态"
                                 v-model="form.status"
                                 row dense style="margin: 0;"
                  >
                    <v-radio
                      v-for="dict in statusOptions"
                      :key="dict.dictValue"
                      :label="dict.dictLabel"
                      :value="dict.dictValue"
                    ></v-radio>
                  </v-radio-group>
                </v-col>

                <v-col cols="12" sm="6" v-if="form.menuType == 'C'">
                  <v-radio-group
                                 label="是否缓存"
                                 v-model="form.isCache"
                                 row dense style="margin: 0;"
                  >
                    <v-radio key="0" value="0" label="缓存"></v-radio>
                    <v-radio key="1" value="1" label="不缓存"></v-radio>
                  </v-radio-group>
                </v-col>
              </v-row>
            </v-container>
            <small class="ml10">*表示必需字段</small>
          </v-card-text>
        </v-form>

        <!-- 底部操作按钮 -->
        <v-card-actions>
          <v-spacer></v-spacer>
          <v-btn
            text
            @click="updateVisible(false)">
            取消
          </v-btn>
          <v-btn
            color="blue darken-1"
            text
            @click="submitForm">
            确定
          </v-btn>
        </v-card-actions>
      </v-card>
    </v-dialog>

    <!-- 嵌套弹窗 -->
    <v-dialog
      v-model="visible2"
      max-width="550px">

      <v-card>
        <v-card-title>
          <span style="font-size: 18px">请选择菜单图标</span>
        </v-card-title>
        <v-container>
          <v-row>
            <v-col cols="12" sm="12" md="12" v-if="form.menuType != 'F'">
              <IconSelect ref="iconSelect" @selected="selected" />
            </v-col>
          </v-row>
        </v-container>
      </v-card>
    </v-dialog>

    <!-- 添加或修改菜单对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
      <el-form :model="form" :rules="rules" label-width="80px">
        <el-row>
          <el-col :span="24">
            <el-form-item label="上级菜单">
              <treeselect
                v-model="form.parentId"
                :options="menuOptions"
                :normalizer="normalizer"
                :show-count="true"
                placeholder="选择上级菜单"
              />
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="菜单类型" prop="menuType">
              <el-radio-group v-model="form.menuType">
                <el-radio label="M">目录</el-radio>
                <el-radio label="C">菜单</el-radio>
                <el-radio label="F">按钮</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item v-if="form.menuType != 'F'" label="菜单图标">
              <el-popover
                placement="bottom-start"
                width="460"
                trigger="click"
                @show="$refs['iconSelect'].reset()"
              >
                <IconSelect ref="iconSelect" @selected="selected" />
                <el-input slot="reference" v-model="form.icon" placeholder="点击选择图标" readonly>
                  <svg-icon
                    v-if="form.icon"
                    slot="prefix"
                    :icon-class="form.icon"
                    class="el-input__icon"
                    style="height: 32px;width: 16px;"
                  />
                  <i v-else slot="prefix" class="el-icon-search el-input__icon" />
                </el-input>
              </el-popover>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="菜单名称" prop="menuName">
              <el-input v-model="form.menuName" placeholder="请输入菜单名称" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="显示排序" prop="orderNum">
              <el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item v-if="form.menuType != 'F'" label="是否外链">
              <el-radio-group v-model="form.isFrame">
                <el-radio label="0">是</el-radio>
                <el-radio label="1">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item v-if="form.menuType != 'F'" label="路由地址" prop="path">
              <el-input v-model="form.path" placeholder="请输入路由地址" />
            </el-form-item>
          </el-col>
          <el-col :span="12" v-if="form.menuType == 'C'">
            <el-form-item label="组件路径" prop="component">
              <el-input v-model="form.component" placeholder="请输入组件路径" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item v-if="form.menuType != 'M'" label="权限标识">
              <el-input v-model="form.perms" placeholder="请权限标识" maxlength="50" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item v-if="form.menuType != 'F'" label="显示状态">
              <el-radio-group v-model="form.visible">
                <el-radio
                  v-for="dict in visibleOptions"
                  :key="dict.dictValue"
                  :label="dict.dictValue"
                >{{dict.dictLabel}}</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item v-if="form.menuType != 'F'" label="菜单状态">
              <el-radio-group v-model="form.status">
                <el-radio
                  v-for="dict in statusOptions"
                  :key="dict.dictValue"
                  :label="dict.dictValue"
                >{{dict.dictLabel}}</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item v-if="form.menuType == 'C'" label="是否缓存">
              <el-radio-group v-model="form.isCache">
                <el-radio label="0">缓存</el-radio>
                <el-radio label="1">不缓存</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listMenu, getMenu, delMenu, addMenu, updateMenu } from "@/api/system/menu";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import IconSelect from "@/components/IconSelect";

export default {
  name: "Menu",
  components: { Treeselect, IconSelect },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 显示搜索条件
      showSearch: true,
      // 菜单表格树数据
      menuList: [],
      // 菜单树选项
      menuOptions: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 显示状态数据字典
      visibleOptions: [],
      // 菜单状态数据字典
      statusOptions: [],
      // 查询参数
      queryParams: {
        menuName: undefined,
        visible: undefined
      },
      // 是否显示编辑对话框
      visible: false,
      visible2: false,
      // 表单参数
      form: {},
      // 是否树形选择
      showMenuOptions: false,
      valid: false,
      // 表单校验
      rules: {
        menuName: [
          val => (val || '').length > 0 || '菜单名称不能为空'
        ],
        orderNum: [
          val => (val || '').length > 0 || '菜单顺序不能为空'
        ],
        path: [
          val => (val || '').length > 0 || '路由地址不能为空'
        ]
      }
    };
  },
  created() {
    this.getList();
    this.getDicts("sys_show_hide").then(response => {
      this.visibleOptions = response.data;
    });
    this.getDicts("sys_normal_disable").then(response => {
      this.statusOptions = response.data;
    });
  },
  methods: {
    // 选择图标
    selected(name) {
      this.form.icon = name;
      this.visible2 = !this.visible2;
    },
    /** 查询菜单列表 */
    getList() {
      this.loading = true;
      listMenu(this.queryParams).then(response => {
        this.menuList = this.handleTree(response.data, "menuId");
        this.loading = false;
      });
    },
    /** 转换菜单数据结构 */
    normalizer(node) {
      if (node.children && !node.children.length) {
        delete node.children;
      }
      return {
        id: node.menuId,
        label: node.menuName,
        children: node.children
      };
    },
    /** 查询菜单下拉树结构 */
    getTreeselect() {
      listMenu().then(response => {
        this.menuOptions = [];
        const menu = { menuId: 0, menuName: '主类目', children: [] };
        menu.children = this.handleTree(response.data, "menuId");
        this.menuOptions.push(menu);
      });
    },
    // 显示状态字典翻译
    visibleFormat(row, column) {
      if (row.menuType == "F") {
        return "";
      }
      return this.selectDictLabel(this.visibleOptions, row.visible);
    },
    // 菜单节点单击事件
    handleNodeClick(data) {
      if (data) {
        this.form.parentId = data.menuId;
        this.form.parentName = data.menuName;
      }
    },
    // 菜单状态字典翻译
    statusFormat(row, column) {
      if (row.menuType == "F") {
        return "";
      }
      return this.selectDictLabel(this.statusOptions, row.status);
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        menuId: undefined,
        parentId: 0,
        menuName: undefined,
        icon: undefined,
        menuType: "M",
        orderNum: undefined,
        isFrame: "1",
        isCache: "0",
        visible: "0",
        status: "0"
      };
      if (this.$refs.form) {
        this.$refs.form.resetValidation();
      }
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.page = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.$refs.queryForm.reset(); // 重置
      this.handleQuery();
    },
    /** 新增按钮操作 */
    handleAdd(row) {
      this.reset();
      this.getTreeselect();
      if (row != null && row.menuId) {
        this.form.parentId = row.menuId;
      } else {
        this.form.parentId = 0;
      }
      this.title = "添加菜单";
      this.visible = true;
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      this.getTreeselect();
      getMenu(row.menuId).then(response => {
        this.form = response.data;
        this.title = "修改菜单";
        this.visible = true;
      });
    },
    validate () {
      this.$refs.form.validate()
    },
    /** 提交按钮 */
    async submitForm() {
      this.$store.commit("snackbar/CLOSE_SNACKBAR");
      await this.validate();
      if (this.valid) {
        if (this.form.menuId != undefined) {
          await updateMenu(this.form).then(res => {
            this.$store.dispatch('snackbar/openSnackbar',{
              msg: '修改成功',
              color: 'success'
            })
            this.getList();
            this.open = false;
            this.visible = false;
          });
        } else {
          await addMenu(this.form).then(res => {
            this.$store.dispatch('snackbar/openSnackbar',{
              msg: '新增成功',
              color: 'success'
            })
            this.getList();
            this.open = false;
            this.visible = false;
          });
        }
      }
    },
    // 表格列点击删除按钮，切换确定删除按钮
    onClickDelete(item) {
      this.$set(item, 'showConfirmDelete', true);
      setTimeout(() => {
        this.$set(item, 'showConfirmDelete', false);
      }, 3500);
    },
    /** 删除按钮操作 */
    async handleDelete(row) {
      this.$store.commit("snackbar/CLOSE_SNACKBAR");
      await delMenu(row.menuId).then(res => {
        if (res) {
          // 使用全局消息提示
          this.$store.dispatch('snackbar/openSnackbar', {
            msg: '删除成功',
            color: 'success'
          })
          this.getList();
        }
      })
    },
    iconSelectReset() {
      if (this.$refs.iconSelect) {
        this.$refs.iconSelect.reset();
      }
    },
    // 调用父级关闭对话框, 并重置表单
    updateVisible(value) {
      this.reset();
      this.open = value;
      this.visible = value;
    },
  }
};
</script>
<style scoped>
  /deep/.el-input__inner {
    border-color: rgba(0, 0, 0, 0.67);
  }

  /deep/.el-input__inner:hover {
    border-color: rgb(56, 116, 203);
  }

</style>
